//
//  GoodsCell.m
//  Leisure
//
//  Created by xalo on 16/6/30.
//  Copyright © 2016年 Hero. All rights reserved.
//

#import "GoodsCell.h"
@interface GoodsCell()<UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIButton *buyBtn;
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UIImageView *coverimg;
@property (nonatomic,strong)UIWebView *webView;
@property (nonatomic,strong)NSString *buyurl;

@end
@implementation GoodsCell


//根据model来设置cell的显示coverimg name
- (void)setCellWithModel:(GoodsModel *)model{
    
    self.title.text = model.title;
    [self.buyBtn addTarget:self action:@selector(buyBtnAction) forControlEvents:UIControlEventTouchUpInside];
    [self.coverimg sd_setImageWithURL:[NSURL URLWithString:model.coverimg]];
    self.buyurl = model.buyurl;
}

- (void)buyBtnAction{
    //通过URL实现浏览器跳转
    [[UIApplication sharedApplication]openURL:[NSURL URLWithString:self.buyurl]];
  
}


- (void)awakeFromNib {
   
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
